import request from '@/utils/request'

// 查询重大事项列表
export function listPost(query) {
  return request({
    url: '/ipc/event/list',
    method: 'get',
    params: query
  })
}

// 查询重大事项详细
export function getPost(postId) {
  return request({
    url: '/system/post/' + postId,
    method: 'get'
  })
}

// 新增重大事项
export function addPost(data) {
  return request({
    url: `/ipc/event`,
    method: 'post',
    data: data
  })
}

// 修改重大事项
export function updatePost(data) {
  return request({
    url: '/system/post',
    method: 'put',
    data: data
  })
}

// 删除重大事项
export function delPost(ids) {
  return request({
    url: '/ipc/event/' + ids,
    method: 'delete'
  })
}

 //  查询事项流程列表
 export function list(query) {  
  return request({
    url: '/ipc/eventProc/list',
    method: 'get',
    params: query
  })
}
 //  根据角色ID查询所有用户信息
export function userListByRoleId(query) {
  return request({
    url: '/ipc/user/userListByRoleId',   
    method: 'get',
    params: query
  })
}

//  同意重大事项
export function agree(data) {
  return request({
      url: '/ipc/event/agree',
      method: 'put',
      data
  })
}

//  驳回重大事项
export function reject(data) {
  return request({
      url: '/ipc/event/reject',
      method: 'put',
      data
  })
}

//  查询事项流程列表
export function eventProcList(query) {  
  return request({
    url: '/ipc/eventProc/list',
    method: 'get',
    params: query
  })
}
